package org.phalanx.server.io;

public class PhalanxServerFileLoader {
	public static final Boolean BINARY_MODE = true;
	public static final Boolean TEXT_MODE = false;
	
	private Byte[] storedData;
	private boolean dataMode;
	
	public PhalanxServerFileLoader(){
		dataMode = true;
	}
	
	public PhalanxServerFileLoader(boolean dataMode){
		this.dataMode = dataMode;
	}
	
	public String getDataAsText(){
		StringBuffer strData = new StringBuffer();
		
		for (int i = 0; i < storedData.length; i++){
			Byte aByte = storedData[i];
			
			if (aByte == 0){
				break;
			}
			
			strData.append((char)aByte.intValue());
		}
		
		return strData.toString();
	}
	
	public Byte[] getDataAsBinary(){
		return storedData;
	}
	
	public Boolean readDataFromFile(String fileName){
		this.getClass().getResource(fileName);
		
		return false;
	}
	
	public static void main(String[] args){
		PhalanxServerFileLoader s = new PhalanxServerFileLoader(false);
		
		s.readDataFromFile("Test.txt");
	}
}
